package com.tinckay.entity.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;
import java.util.List;

import com.tinckay.common.constant.ProjectConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;

/**
 * <p>
 *
 * </p>
 *
 * @author Jean
 * @since 2018-10-21
 */
@Data
@Accessors(chain = true)
@TableName("pour_task")
@ApiModel(value = "Task对象", description = "运输任务")
public class Task extends Model<Task> {

    private static final long serialVersionUID = 4976643960194123453L;

    @NotNull(message = "id不能为空", groups = ProjectConstant.Update.class)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "用户id")
    private Long userId;

    @ApiModelProperty(value = "驾驶人员姓名")
    private String driverName;

    @ApiModelProperty(value = "仓体编号")
    private String barnNo;

    @ApiModelProperty(value = "车辆编号")
    private String vehNo;

    @ApiModelProperty(value = "开始时间")
    private LocalDateTime startTime;

    @ApiModelProperty(value = "结束时间")
    private LocalDateTime endTime;

    @ApiModelProperty(value = "耗时时长（秒）")
    private Long consumeTime;

    @ApiModelProperty(value = "任务状态 0开始装料 1装料结束 2运输结束 3卸料结束 4卸料暂停 5任务结束")
    private Integer taskStatus;

    @ApiModelProperty(value = "任务类型")
    private Integer taskType;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime dataTime;

    @ApiModelProperty(value = "创建时间", hidden = true)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间", hidden = true)
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private List<TranProcess> tranProcessList;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
